package be.vsko.zelfevaluatie.rest;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;

@Path("/")
public class RootServlet extends RoaServlet{
	private enum Resource {surveys, evaluations, responses, statements};
	
	@GET
	@Produces(MediaType.APPLICATION_JSON)
	public JSONObject getIndex() {
		JSONObject j = new JSONObject();
		try {
			for(Resource res : Resource.values()) {
				j.put(res.toString(), getHref("/"+res.toString()) );
			}
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return j;
	}
}
